package samsung.sds.resourceManagement.service;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;

import samsung.sds.resourceManagement.model.ResourceEntity;
import samsung.sds.resourceManagement.model.ResourceToRole;
import samsung.sds.roleManagement.model.RoleManagementEntity;
import samsung.sds.system.common.baseQuery.BaseServiceInterface;
/** 
 * @author pt.fang
 * @createDate 2016-01-15
 * @modifier by fei3.liu
 * @modificationDate 2016-02-23
 * 资源管理  Service接口
 */
public interface ResourceManagementService extends BaseServiceInterface<ResourceEntity>{

	/**
	 * 根据资源地址查询资源信息
	 * @param resUrl 资源地址
	 * @return 
	 */
	boolean checkResource(String resUrl,String optype,String res_url);
	 
	/**
	 * 得到除已有角色之外的所有角色集合
	 * @return 
	 */
	List<RoleManagementEntity> getResToRoleList(String id);
	
	/**
	 * 通过资源ID查询角色信息
	 * @param id
	 * @return List
	 */
	List<ResourceToRole> getRoleArray(String id);
	
	/**
	 * 判断资源是否受保护
	 * @param urls
	 * @param request
	 * @return 
	 */
	public void checkProtectedRes(List<ResourceEntity> urls,HttpServletRequest request);
	
	/**
	 * 获取所有映射并添加到资源实体对象集合中
	 */
	public void mapList(Map<RequestMappingInfo, HandlerMethod> handlerMethods,List<ResourceEntity> urls);
}
